package com.itheima.mall.service.oms;


import com.itheima.mall.api.oms.OrderApi;
import com.itheima.mall.dto.OrderDto;
import com.itheima.mall.pojo.oms.OmsOrder;
import com.itheima.mall.vo.OrderDetailVo;
import com.itheima.mall.vo.PageResult;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class OrderService {
    @DubboReference
    private OrderApi orderApi;

 public void deleteOrderByIds(Integer[] ids) {
        orderApi.deleteOrderByIds(ids);
    }


    public  PageResult listOrder(OrderDto orderDto) {
        return orderApi.listAll(orderDto);
//        PageResult result = new PageResult();
//        result.setPageNum(orderDto.getPageNum());
//        result.setPageSize(orderDto.getPageSize());
//        result.setList(omsOrderList);
//        return result;
    }

    public void closeOrder(Integer[] ids, String note) {
            orderApi.closeOrder(ids,note);
    }

    public void deliveryOrder(HashMap deliveryParamList) {
        orderApi.deliveryOrder(deliveryParamList);
    }

  public void updateMoneyInfo(HashMap moneyInfoParam ) {
        orderApi.updateMoneyInfo(moneyInfoParam);
    }

/**
     * 备注订单
     * @param id
     * @param note
     * @param status
     * @return
     */

    public void updateNote(Integer id, String note, Integer status) {
        orderApi.updateNote(id,note,status);
    }
/**
     * 修改收货人信息
     * @param omsOrder
     * @return*/
    public void updateReceiverInfo(OmsOrder omsOrder) {
        orderApi.updateReceiverInfo(omsOrder);
    }

    public OrderDetailVo orderList(Integer id) {
         return orderApi.orderDetail(id);
    }
}
